
CC := gcc
CXX := g++
CFLAGS := -pthread  #-Wall

SRC := main.c icar_log.c icar_msg.c icar_utils.c icar_pkg.c icar_end_msg.c \
	   icar_flat_msg.c icar_thread.c
TEST:= icar_test.c icar_log.c icar_msg.c icar_utils.c icar_pkg.c \
	   icar_end_msg.c icar_flat_msg.c icar_thread.c

OBJ := icar_log.o icar_msg.o icar_utils.o icar_pkg.o icar_end_msg.o \
	   icar_flat_msg.o icar_thread.o icar_parse.o

ICAR := main.o $(OBJ)

ICAR_TEST := icar_test.o $(OBJ)

TARGET := icar
TEST_TAR := icar_test

all: $(ICAR)
	$(CC) $(CFLAGS) $(ICAR) -o $(TARGET)

test: $(ICAR_TEST)
	$(CC) $(CFLAGS) $(ICAR_TEST) -o $(TEST_TAR)

distclean:
	$(MAKE)	clean
	rm -rf $(TARGET) $(TEST_TAR)
	
clean:
	rm -rf *.o
